package com.aspose.cells;

class zatu {
   byte a = 5;
   int b;
   zatt c = new zatt();

   int a() {
      switch((this.a & 255 & 12) >> 2) {
      case 0:
         return 3;
      case 1:
         return 2;
      case 2:
         return 0;
      case 3:
         return 1;
      default:
         return 2;
      }
   }

   void a(int var1) {
      byte var2 = 0;
      switch(var1) {
      case 0:
         var2 = 2;
         break;
      case 1:
         var2 = 3;
         break;
      case 2:
         var2 = 1;
      case 3:
      }

      this.a = (byte)(this.a & 51);
      this.a |= (byte)((var2 & 255) << 2);
   }

   int b() {
      switch(this.a & 255 & 3) {
      case 0:
         return 1;
      case 1:
         return 0;
      case 2:
         return 2;
      case 3:
         return 3;
      default:
         return 0;
      }
   }

   void b(int var1) {
      byte var2 = 0;
      switch(var1) {
      case 0:
         var2 = 1;
         break;
      case 1:
         var2 = 0;
         break;
      case 2:
         var2 = 2;
         break;
      case 3:
         var2 = 3;
      }

      this.a = (byte)(this.a & 60);
      this.a |= var2;
   }

   void a(byte[] var1, int var2) {
      byte var3 = 4;
      this.b = com.aspose.cells.b.a.zc.e(var1, var3) & '\uffff';
      int var14 = var3 + 2;
      this.a = var1[var14];
      var14 += 2;
      int var4 = com.aspose.cells.b.a.zc.e(var1, var14) & '\uffff';
      var14 += 2;
      int var5 = com.aspose.cells.b.a.zc.e(var1, var14) & '\uffff';
      var14 += 4;
      String var6 = null;
      if (var5 == 0) {
         var14 += 2;
      } else {
         var6 = Encoding.getUnicode().a(var1, var14, var5);
         var14 += 2 * var5;
         zats var7;
         if (var4 == 0) {
            var7 = new zats();
            var7.a = 0;
            var7.b = var2;
            var7.c = var6;
            this.c.a(var7);
         } else {
            var7 = null;
            int var8 = 0;

            for(int var9 = 0; var9 < var4; ++var9) {
               int var10 = com.aspose.cells.b.a.zc.e(var1, var14) & '\uffff';
               if (var10 >= var6.length()) {
                  if (var7 != null) {
                     var7.c = var6.substring(var8);
                  }

                  return;
               }

               int var11 = com.aspose.cells.b.a.zc.e(var1, var14 + 2) & '\uffff';
               int var12 = com.aspose.cells.b.a.zc.e(var1, var14 + 4) & '\uffff';
               zats var13 = new zats();
               var13.a = var11;
               var13.b = var12 - var11 + 1;
               this.c.a(var13);
               if (var7 != null) {
                  var7.c = var6.substring(var8, var8 + var10 - var8 + 1);
               }

               var7 = var13;
               var8 = var10;
               var14 += 6;
            }

            if (var7 != null) {
               var7.c = var6.substring(var8);
            }
         }

      }
   }

   byte[] c(int var1) {
      if (this.c.getCount() == 0) {
         return null;
      } else {
         int var2 = 14 + this.c.getCount() * 6;
         StringBuilder var3 = new StringBuilder();

         for(int var4 = 0; var4 < this.c.getCount(); ++var4) {
            var3.append(this.c.a(var4).c);
            var2 += this.c.a(var4).c.length() * 2;
         }

         byte[] var9 = new byte[var2];
         byte var5 = 0;
         var9[var5] = 1;
         int var10 = var5 + 2;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2 - 4), 0, var9, var10, 2);
         var10 += 2;
         System.arraycopy(com.aspose.cells.b.a.zc.a(this.b), 0, var9, var10, 2);
         var10 += 2;
         var9[var10] = this.a;
         var10 += 2;
         System.arraycopy(com.aspose.cells.b.a.zc.a(this.c.getCount()), 0, var9, var10, 2);
         var10 += 2;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var3.length()), 0, var9, var10, 2);
         var10 += 2;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var3.length()), 0, var9, var10, 2);
         var10 += 2;
         System.arraycopy(Encoding.getUnicode().a(com.aspose.cells.b.a.zr.a(var3)), 0, var9, var10, var3.length() * 2);
         var10 += var3.length() * 2;
         int var6 = 0;

         for(int var7 = 0; var7 < this.c.getCount(); ++var7) {
            zats var8 = this.c.a(var7);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var9, var10, 2);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var8.a), 0, var9, var10 + 2, 2);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var8.b + var8.a - 1), 0, var9, var10 + 4, 2);
            var6 += var8.c.length();
            var10 += 6;
         }

         return var9;
      }
   }
}
